<html>
<head>
	<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
	<title>evo-league Fiveserver/Sixserver Registration Form</title>
	<style type="text/css">
	<!--
		body {
			font-family: 'Roboto', sans-serif;
		}
	-->
	</style>
</head>
<body>
<script src="/md5.js" type="text/javascript"></script>
<script>
function makeHash() {
    a = document.getElementById('serial').value;
    a = a.replace(/^\s+/,'').replace(/\s+$/,'').replace(/-/g,'').toUpperCase();
    if (!a.match(/^[A-Z0-9]{20}$/)) {
        alert('The serial number appears to be invalid. Please enter a good one');
        return false;
    }
    document.getElementById('serial').value = a;
    while(a.length<36) { a += '\0'; }
    u = document.getElementById('username').value;
    u = u.replace(/^\s+/,'').replace(/\s+$/,'');
    if (u.length<3 || !u.match(/^[0-9a-zA-Z]+$/)) {
        alert('Invalid username. Must be 3+ characters long and contain only letters and digits');
        return false;
    }
    p = document.getElementById('password').value;
    if (p.length<3) {
        alert('Password too short. Must be 3+ characters long');
        return false;
    }
    document.getElementById('hash').value = hex_md5(a+u+'-'+p);
    return true;
} 
</script>
<h3>Fiveserver/Sixserver Registration Form (PES6 open beta)</h3>
<p><a href="https://sites.google.com/site/fiveservercom/configure-and-play#TOC-User-Registration" target="_new">Read these instructions first!</a></p>
<p>Remember you have to modify your system's hosts file (usually located in C:/WINDOWS/system32/drivers/etc/ folder) and add this line at the end:<br><br>
46.182.19.200 pes6gate-ec.winning-eleven.net</p>
<p><b>Please note:</b> evo-league's Sixserver instance is currently in open beta. After the beta, you'll need a (free) evo-league account to play. You can sign up for an account <a href="http://www.evo-league.com/join.php">here</a>.</p>
<p>Please participate in the beta process by posting in the <a href="http://www.evo-league.com/forum/viewtopic.php?t=5339">Fiveserver/Sixserver beta thread</a>.</p>
<div class="FormBody">
<form name="registration" action="/register" method="POST">
<input type="hidden" name="nonce" id="nonce" value="%(nonce)s"/>
<input type="hidden" name="hash" id="hash" size="32" value=""/>
<strong>Serial:</strong><br />
<input type="text" name="serial" id="serial" size="40" value="%(serial)s" onkeydown="if (event.keyCode == 13) {document.getElementById('btnGen').click(); return false;}" /><br />
<br />
<strong>Username:</strong><br />
<input type="text" name="user" id="username" size="40" value="%(username)s" onkeydown="if (event.keyCode == 13) {document.getElementById('btnGen').click(); return false;}" /><br />
</form>
<strong>Password:</strong><br />
<input type="password" id="password" size="40" value="" onkeydown="if (event.keyCode == 13) {document.getElementById('btnGen').click(); return false;}" /><br />
<p>
<input class="button" type="button" id="btnGen" value="Register" onclick="if (makeHash()) {document.forms['registration'].submit();}" />
</p>
</div>
</body>
</html>
